<?php

namespace common\extended\ocs;

/**
 *
 *
    use common\extended\ocs\Functions;

    $m = new Functions();
    $m->set('key', 'value', 600); // 设置一个key的值，有效期为600s
    $m->get('key'); // 获取一个key的值
    $m->delete('key'); // 删除一个key的值
 *
 */

class Functions extends MemcacheSASL
{
    protected $config = [
        'host' => '', // OCS内网地址
        'port' => '11211',
        'username' => '', // 访问账号（OCS详情里面可以查看到）
        'password' => '' // 密码
    ];

    public function __construct()
    {
        $this->addServer($this->config['host'], $this->config['port']);
        $this->setSaslAuthData($this->config['username'], $this->config['password']);
    }
}